#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2021/10/18 22:18 
# @File           : crud.py
# @IDE            : PyCharm
# @desc           : 数据库 增删改查操作
import json
from typing import List, Optional
from fastapi import HTTPException
from fastapi.encoders import jsonable_encoder
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import Session
from starlette import status

from core.crud import DalBase
from . import models, schemas
from sqlalchemy import or_


# sqlalchemy 查询操作：https://segmentfault.com/a/1190000016767008


class CustomerDal(DalBase):

    def __init__(self, db: AsyncSession):
        super(CustomerDal, self).__init__(db, models.Customer, schemas.CustomerSimpleOut)
